package com.feihao.zhou.service.impl;

import com.feihao.zhou.dao.UserDao;
import com.feihao.zhou.service.UserService;

import java.util.Date;

public class UserServiceImpl implements UserService {
    private UserDao userDao;
    private String name;
    private int age;
    private Date birthday;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public void init(){
        System.out.println("初始化方法执行了");
    }

    public void save() {
        System.out.println("userService的方法执行了");
        userDao.save();//打印userdao执行了
        System.out.println(name + "," + age + "," + birthday);
    }

    public void destroy(){
        System.out.println("销毁方法执行了");
    }
}
